const axios = require('axios');
// 搜索参数
const URL='http://47.97.65.11:3002/data-engine/search-list'
const bar_URL ='http://47.97.65.11:3002/data-engine/search-bar-graph-data'
const zhexian_URL ='http://47.97.65.11:3002/data-engine/search-line-chart-data'
export class zhexianSearchArgs{
  constructor() {
    this.f011=''
  }
}
export class barSearchArgs{
  constructor() {
    this.f011=''
  }
}
export class SearchArgs{
  constructor() {
    this.offset=0
    this.num=10

  }
}
export async function searchDataEngineDetailData(
  searchArgs = new SearchArgs()
){
  try {
    const res = await axios({
      method: 'get',
      url: URL ,
      params: {
        ...searchArgs
      },
      withCredentials:false
    })
    return res;
  }
  catch (error) {
    console.error(error)
  }
}
export async function zhexianData(f011) {
  try {
    const res = await axios({
      method: 'get',
      url: zhexian_URL ,
      params: {
        f011:f011
      },
      withCredentials:false
    })
    return res;
  }
  catch (error) {
    console.error(error)
  }
}
export async function barData(f011) {
  try {
    const res = await axios({
      method: 'get',
      url: bar_URL ,
      params: {
        f011:f011
      },
      withCredentials:false
    })
    return res;
  }
  catch (error) {
    console.error(error)
  }
}

